home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / w3 / dsssl-flow.el.z / dsssl-flow.el
Encoding:
Text File  |  1998-05-21  |  3.9 KB  |  125 lines

  1. ;;; dsssl-flow.el --- DSSSL flow objects
  2. ;; Author: wmperry
  3. ;; Created: 1997/10/17 14:07:55
  4. ;; Version: 1.4
  5. ;; Keywords: 
  6.  
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8. ;;; Copyright (c) 1996, 1997 by William M. Perry <wmperry@cs.indiana.edu>
  9. ;;; Copyright (c) 1997 by Free Software Foundation, Inc.
  10. ;;;
  11. ;;; This file is part of GNU Emacs.
  12. ;;;
  13. ;;; GNU Emacs is free software; you can redistribute it and/or modify
  14. ;;; it under the terms of the GNU General Public License as published by
  15. ;;; the Free Software Foundation; either version 2, or (at your option)
  16. ;;; any later version.
  17. ;;;
  18. ;;; GNU Emacs is distributed in the hope that it will be useful,
  19. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21. ;;; GNU General Public License for more details.
  22. ;;;
  23. ;;; You should have received a copy of the GNU General Public License
  24. ;;; along with GNU Emacs; see the file COPYING.  If not, write to the
  25. ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  26. ;;; Boston, MA 02111-1307, USA.
  27. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  28.  
  29. (defstruct flow-object
  30.   (type 'unknown :read-only t)        ; Name of this flow object
  31.   (properties nil)
  32.   (children nil)
  33.   (parent nil)
  34.   )
  35.  
  36. (defstruct dsssl-flow-processor
  37.   (name 'unknown :read-only t)        ; Name of this processing backend
  38.   (init nil)                ; initialize the backend
  39.   (handler nil)                ; handle a single flow object
  40.   (sizeof nil)                ; get size of a single flow object
  41.   (clean nil)                ; cleanup instance of backend
  42.   )
  43.  
  44. (defvar dsssl-flow-active-faces nil)
  45. (defvar dsssl-flow-active-voices nil)
  46. (make-variable-buffer-local 'dsssl-flow-active-faces)
  47. (make-variable-buffer-local 'dsssl-flow-active-voices)
  48.  
  49. (defun dsssl-flow-display (flows processor)
  50.   (let ((handler (dsssl-flow-processor-handler processor))
  51.     (flow-stack (list flows))
  52.     (content nil)
  53.     (node nil)
  54.     (last-object nil)
  55.     )
  56.     (while flow-stack
  57.       (setq content (pop flow-stack))
  58.       (dsssl-flow-progress-meter)
  59.       ;; Handle the element's content
  60.       (while content
  61.     (dsssl-flow-progress-meter)
  62.     (if (stringp (car content))
  63.         (dsssl-flow-handle-string-content (pop content))
  64.       (setq node (pop content))
  65.       ;; todo: collect all information about this flow object for faster
  66.       ;; lookup later.
  67.       (push (dsssl-flow-face-for-element node) dsssl-flow-active-faces)
  68.       (push (dsssl-flow-voice-for-element node) dsssl-flow-active-voices))
  69.       (case (flow-object-type node)
  70.         ;; Core DSSL components  basic flow object classes
  71.         (sequence            ; 12.6.1
  72.          )
  73.         (display-group        ; 12.6.2
  74.          )
  75.         (paragraph            ; 12.6.6
  76.          )
  77.         (paragraph-break        ; 12.6.7
  78.          )
  79.         (external-graphic        ; 12.6.15
  80.          )
  81.         ;; DSSSL options required in DSSSL online
  82.         ;; Simple page flow object class
  83.         (simple-page-sequence    ; 12.6.3
  84.          )
  85.         ;; Table flow object classes
  86.         (table            ; 12.6.27.1
  87.          )
  88.         (table-part            ; 12.6.27.2
  89.          )
  90.         (table-column        ; 12.6.27.3
  91.          )
  92.         (table-row            ; 12.6.27.5
  93.          )
  94.         (table-border        ; 12.6.27.7
  95.          )
  96.         (table-cell            ; 12.6.27.6
  97.          ;; Do we need to handle table-cell at this level, or is that
  98.          ;; something that the display backend needs to handle, and we
  99.          ;; just query that in the `table-row' processor?
  100.          )
  101.         ;; Online display flow object classes
  102.         (vertical-scroll        ; 12.6.28.1
  103.          )
  104.         (multi-mode            ; 12.6.28.2
  105.          )
  106.         (marginalia            ; 12.6.28.4
  107.          )
  108.         ;; Emacs/W3 specific flow objects
  109.         (applet            ; Wow, Java
  110.          )
  111.         (script            ; Scripts
  112.          )
  113.         (form-element        ; Any form element
  114.          )
  115.         ;; pinhead, flame, and cookie can now all be handled by
  116.         ;; a stud-muffing DSSSL stylesheet - hooray!
  117.  
  118.         ;; Generic formatting - all things that can be fully specified
  119.         ;; by a CSS stylesheet.
  120.         (otherwise
  121.          ;; handle the content
  122.          (dsssl-flow-handle-content node)))))))
  123.  
  124. (provide 'dsssl-flow)
  125.